package cn.hlyc.controller;

import cn.hlyc.User;
import cn.hlyc.feign.UserFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PayController {

    @Autowired
    private UserFeign userFeign;

    @GetMapping("getUser/{id}")
    public User getUser(@PathVariable("id") Long userId){
        //通过openfeign 来调用user的接口
        return userFeign.getUserById(userId);
    }
}
